import React, { Component } from 'react';

import Nav from './nav.jsx';
import More from './more.jsx';


class View extends Component {
    constructor(props){
        super(props);
        this.state = {
            log:'000',
            data:{
                name:'小王',
                age:32,
                title:'标题四'
            }
        }
    }
    /**
        this.setState({

        })
    **/
    fn(e,arg){
        console.log(arg)
        this.setState({
            log:arg
        })
    }
    fn2(e,log){
        console.log('这是a标签',log);
    }
    render(){
        /*
        const arr1 = [1,2,3,4];
        const arr3 = [9,10,11,14];
        const arr2 = [...arr1,...arr3];
        console.log(arr2);
        const obj1 = {
            name:'小红',
            age:27
        }
        const obj2 = {
            class:'二班'
        }
        const obj3 = {
            ...obj1,
            ...obj2
        }
        console.log(Object.assign(obj1,obj2))
        console.log(obj3)
        console.log({...obj1,...obj2})
        */
        return(
            <React.Fragment>
                <div>111</div>
                <div>222</div>
                <Nav callback={this.fn.bind(this)} more={<More callback={this.fn2.bind(this)}/>} {...this.state.data}>
                    <span>{this.state.log}副标题</span>
                </Nav>
                {
                    /*

                    <Nav title="标题一">
                        <em>&copy;</em>
                    </Nav>
                    <Nav title="标题二"/>
                    <Nav title="标题三"/>
                    */
                }

            </React.Fragment>
        )
    }
}

export default View;
